public class Solution {
    public static int hammingDistance(int x, int y) {
        int i = 0;
        int j = 0;
        int k = 0;
        while(x/2!=0 || y/2!=0){
            i= x % 2;
            j= y % 2;
            x = x/2;
            y = y/2;
            if(i!=j){
                k++;
            }
        }
        return k;

    }

    public static void main(String[] args) {
        System.out.println(hammingDistance(1, 4));
    }
}
